<table class="traders">
  <tbody>
    <?php foreach ($traders as $i => $trader): ?>
      <tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>">
        <td>
          <a href="<?php echo url_for('trader_profile', $trader->getSfGuardUser()) ?>"><img height="50" width="50" src="<?php echo (($picture =$trader->getPicture()) == NULL) ?
                  '/images/unknown.gif' : '/uploads/traders/'.$picture ?>" /></a>
        </td>
        <td>
          <?php echo $trader->getSfGuardUser()->getUsername() ?>
        </td>
        <?php if ($order == 'follower'): ?>
          <td><?php echo count($trader->getTrades()) ?></td>
          <td><?php echo $trader->getFollowerCount() ?></td>
          <td><?php echo count($trader->getFolloweds()) ?></td>
        <?php elseif ($order == 'followed'): ?>
          <td><?php echo count($trader->getTrades()) ?></td>
          <td><?php echo count($trader->getFollowers()) ?></td>
          <td><?php echo $trader->getFollowedCount() ?></td>
        <?php elseif ($order == 'trade'): ?>
          <td><?php echo $trader->getTradeCount() ?></td>
          <td><?php echo count($trader->getFollowers()) ?></td>
          <td><?php echo count($trader->getFolloweds()) ?></td>
        <?php elseif ($order == 'username'): ?>
          <td><?php echo count($trader->getTrades()) ?></td>
          <td><?php echo count($trader->getFollowers()) ?></td>
          <td><?php echo count($trader->getFolloweds()) ?></td>
        <?php endif ?>
          <td></td>
        <td><?php echo $trader->getJob() ?></td>
      </tr>
    <?php endforeach ?>
  </tbody>
  <thead>
    <th><?php echo __('Picture') ?></th>
    <th><?php echo link_to(__('Username'), 'trader/index?order=username&sort='.$sort) ?></th>
    <th><?php echo link_to(__('Posted trade'), 'trader/index?order=trade&sort='.$sort) ?></th>
    <th><?php echo link_to(__('Followers'), 'trader/index?order=follower&sort='.$sort) ?></th>
    <th><?php echo link_to(__('Followed'), 'trader/index?order=followed&sort='.$sort) ?></th>
    <th><?php //echo link_to(__('Job'), 'trader/index?order='.TraderTable::ORDER_BY_FOLLOWER) ?></th>
  </thead>
</table>